3.2.9 \(\int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx\) [109]

Optimal. Leaf size=101 \[ \frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}-\frac {4 d^2 \text {PolyLog}\left (2,-i e^{e+f x}\right )}{a f^3}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f} \]

[Out]

(d*x+c)^2/a/f-4*d*(d*x+c)*ln(1+I*exp(f*x+e))/a/f^2-4*d^2*polylog(2,-I*exp(f*x+e))/a/f^3+(d*x+c)^2*tanh(1/2*e+1
/4*I*Pi+1/2*f*x)/a/f

________________________________________________________________________________________

Rubi [A]
time = 0.15, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3399, 4269, 3797, 2221, 2317, 2438} \begin {gather*} -\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{a f}+\frac {(c+d x)^2}{a f}-\frac {4 d^2 \text {Li}_2\left (-i e^{e+f x}\right )}{a f^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(a + I*a*Sinh[e + f*x]),x]

[Out]

(c + d*x)^2/(a*f) - (4*d*(c + d*x)*Log[1 + I*E^(e + f*x)])/(a*f^2) - (4*d^2*PolyLog[2, (-I)*E^(e + f*x)])/(a*f
^3) + ((c + d*x)^2*Tanh[e/2 + (I/4)*Pi + (f*x)/2])/(a*f)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3797

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)], x_Symbol] :> Simp[(-I)*((
c + d*x)^(m + 1)/(d*(m + 1))), x] + Dist[2*I, Int[((c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*
fz*x))/E^(2*I*k*Pi))))/E^(2*I*k*Pi), x], x] /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx &=\frac {\int (c+d x)^2 \csc ^2\left (\frac {1}{2} \left (i e+\frac {\pi }{2}\right )+\frac {i f x}{2}\right ) \, dx}{2 a}\\ &=\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}-\frac {(2 d) \int (c+d x) \coth \left (\frac {e}{2}-\frac {i \pi }{4}+\frac {f x}{2}\right ) \, dx}{a f}\\ &=\frac {(c+d x)^2}{a f}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}-\frac {(4 i d) \int \frac {e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )} (c+d x)}{1+i e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}} \, dx}{a f}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}+\frac {\left (4 d^2\right ) \int \log \left (1+i e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}\right ) \, dx}{a f^2}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}+\frac {\left (4 d^2\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}\right )}{a f^3}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}-\frac {4 d^2 \text {Li}_2\left (-i e^{e+f x}\right )}{a f^3}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.58, size = 139, normalized size = 1.38 \begin {gather*} \frac {2 \left (\frac {d e^e f^2 x (2 c+d x)}{-i+e^e}-2 d f (c+d x) \log \left (1+i e^{e+f x}\right )-2 d^2 \text {PolyLog}\left (2,-i e^{e+f x}\right )+\frac {f^2 (c+d x)^2 \sinh \left (\frac {f x}{2}\right )}{\left (\cosh \left (\frac {e}{2}\right )+i \sinh \left (\frac {e}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (e+f x)\right )+i \sinh \left (\frac {1}{2} (e+f x)\right )\right )}\right )}{a f^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(a + I*a*Sinh[e + f*x]),x]

[Out]

(2*((d*E^e*f^2*x*(2*c + d*x))/(-I + E^e) - 2*d*f*(c + d*x)*Log[1 + I*E^(e + f*x)] - 2*d^2*PolyLog[2, (-I)*E^(e
 + f*x)] + (f^2*(c + d*x)^2*Sinh[(f*x)/2])/((Cosh[e/2] + I*Sinh[e/2])*(Cosh[(e + f*x)/2] + I*Sinh[(e + f*x)/2]
))))/(a*f^3)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (90 ) = 180\).
time = 0.98, size = 227, normalized size = 2.25

method result size
risch \(\frac {2 i \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{f a \left ({\mathrm e}^{f x +e}-i\right )}-\frac {4 d \ln \left ({\mathrm e}^{f x +e}-i\right ) c}{a \,f^{2}}+\frac {4 d \ln \left ({\mathrm e}^{f x +e}\right ) c}{a \,f^{2}}+\frac {2 d^{2} x^{2}}{a f}+\frac {4 d^{2} e x}{a \,f^{2}}+\frac {2 d^{2} e^{2}}{a \,f^{3}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) x}{a \,f^{2}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) e}{a \,f^{3}}-\frac {4 d^{2} \polylog \left (2, -i {\mathrm e}^{f x +e}\right )}{a \,f^{3}}+\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}-i\right )}{a \,f^{3}}-\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}\right )}{a \,f^{3}}\) \(227\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/(a+I*a*sinh(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2*I*(d^2*x^2+2*c*d*x+c^2)/f/a/(exp(f*x+e)-I)-4/a/f^2*d*ln(exp(f*x+e)-I)*c+4/a/f^2*d*ln(exp(f*x+e))*c+2/a/f*d^2
*x^2+4/a/f^2*d^2*e*x+2/a/f^3*d^2*e^2-4/a/f^2*d^2*ln(1+I*exp(f*x+e))*x-4/a/f^3*d^2*ln(1+I*exp(f*x+e))*e-4*d^2*p
olylog(2,-I*exp(f*x+e))/a/f^3+4/a/f^3*d^2*e*ln(exp(f*x+e)-I)-4/a/f^3*d^2*e*ln(exp(f*x+e))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="maxima")

[Out]

-2*d^2*(-I*x^2/(a*f*e^(f*x + e) - I*a*f) + 2*I*integrate(x/(a*f*e^(f*x + e) - I*a*f), x)) + 4*c*d*(x*e^(f*x +
e)/(a*f*e^(f*x + e) - I*a*f) - log((e^(f*x + e) - I)*e^(-e))/(a*f^2)) - 2*c^2/((I*a*e^(-f*x - e) - a)*f)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 212 vs. \(2 (89) = 178\).
time = 0.38, size = 212, normalized size = 2.10 \begin {gather*} -\frac {2 \, {\left (-i \, c^{2} f^{2} + 2 i \, c d f e - i \, d^{2} e^{2} + 2 \, {\left (d^{2} e^{\left (f x + e\right )} - i \, d^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (f x + e\right )}\right ) - {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + 2 \, c d f e - d^{2} e^{2}\right )} e^{\left (f x + e\right )} + 2 \, {\left (-i \, c d f + i \, d^{2} e + {\left (c d f - d^{2} e\right )} e^{\left (f x + e\right )}\right )} \log \left (e^{\left (f x + e\right )} - i\right ) + 2 \, {\left (-i \, d^{2} f x - i \, d^{2} e + {\left (d^{2} f x + d^{2} e\right )} e^{\left (f x + e\right )}\right )} \log \left (i \, e^{\left (f x + e\right )} + 1\right )\right )}}{a f^{3} e^{\left (f x + e\right )} - i \, a f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="fricas")

[Out]

-2*(-I*c^2*f^2 + 2*I*c*d*f*e - I*d^2*e^2 + 2*(d^2*e^(f*x + e) - I*d^2)*dilog(-I*e^(f*x + e)) - (d^2*f^2*x^2 +
2*c*d*f^2*x + 2*c*d*f*e - d^2*e^2)*e^(f*x + e) + 2*(-I*c*d*f + I*d^2*e + (c*d*f - d^2*e)*e^(f*x + e))*log(e^(f
*x + e) - I) + 2*(-I*d^2*f*x - I*d^2*e + (d^2*f*x + d^2*e)*e^(f*x + e))*log(I*e^(f*x + e) + 1))/(a*f^3*e^(f*x
+ e) - I*a*f^3)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {2 i c^{2} + 4 i c d x + 2 i d^{2} x^{2}}{a f e^{e} e^{f x} - i a f} - \frac {4 i d \left (\int \frac {c}{e^{e} e^{f x} - i}\, dx + \int \frac {d x}{e^{e} e^{f x} - i}\, dx\right )}{a f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/(a+I*a*sinh(f*x+e)),x)

[Out]

(2*I*c**2 + 4*I*c*d*x + 2*I*d**2*x**2)/(a*f*exp(e)*exp(f*x) - I*a*f) - 4*I*d*(Integral(c/(exp(e)*exp(f*x) - I)
, x) + Integral(d*x/(exp(e)*exp(f*x) - I), x))/(a*f)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)^2/(I*a*sinh(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c+d\,x\right )}^2}{a+a\,\mathrm {sinh}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^2/(a + a*sinh(e + f*x)*1i),x)

[Out]

int((c + d*x)^2/(a + a*sinh(e + f*x)*1i), x)

________________________________________________________________________________________